<?php 
namespace app\chat\model;

use think\Model;

class Member extends Model
{
	protected $table = 'db_member ';

	protected $pk = 'id';

    /*
     * 查询指定值
     */
    public function getValue($map,$field){
        return $this->where($map)->value($field);
    }

    /*
     * 查询信息
     */
    public function getMember($map,$field='*'){
        return $this->where($map)->field($field)->find();
    }

    /*
     *  更新信息
     */
    /*public function updateData($map,$data){
        return;
        return $this->where($map)->setField($data);
    }*/

    //添加信息
    public function addData($data){
        return $this->insert($data);
    }



    /*
     * 根据条件返回数据
     */
    public function getWhereList($map,$field){
        return $this->field($field)->where($map)->order('id desc')->select();
    }



}